/**
 * Created by caomenglong on 16/3/10.
 */
/*
 商品分类列表使用的控制器
 */

app.controller('ProductClassifyCtrl',['$scope','$timeout','$location',function($scope,$timeout,$location){

    var path =$location.path();
    if(path.indexOf('search')>0){
        $scope.uriflag='searchdetail';
    }else{
        $scope.uriflag='detail';
    }

    $scope.title="世果爆款";
    $scope.hasmore=true;
    $scope.items=[
        {"img":"http://7xk7h0.com1.z0.glb.clouddn.com/2016-03-03_56d801d1a54e3.jpg", "name":"优选-亲情树进口香蕉（约8把)","spname":"约28斤/箱（约8把）","price":"118.0"},
        {"img":"http://7xk7h0.com1.z0.glb.clouddn.com/2016-03-03_56d801d1a54e3.jpg", "name":"优选-亲情树进口香蕉（约8把)","spname":"约28斤/箱（约8把）","price":"118.0"},
        {"img":"http://7xk7h0.com1.z0.glb.clouddn.com/2016-03-03_56d801d1a54e3.jpg", "name":"优选-亲情树进口香蕉（约8把)","spname":"约28斤/箱（约8把）","price":"118.0"},
        {"img":"http://7xk7h0.com1.z0.glb.clouddn.com/2016-03-03_56d801d1a54e3.jpg", "name":"优选-亲情树进口香蕉（约8把)","spname":"约28斤/箱（约8把）","price":"118.0"},
        {"img":"http://7xk7h0.com1.z0.glb.clouddn.com/2016-03-03_56d801d1a54e3.jpg", "name":"优选-亲情树进口香蕉（约8把)","spname":"约28斤/箱（约8把）","price":"118.0"},

    ];
    $scope.doRefresh=function(){
        $scope.$broadcast('scroll.refreshComplete');
    }
    $scope.loadMore=function(){
        $timeout(function(){
            $scope.items.push({"img":"http://7xk7h0.com1.z0.glb.clouddn.com/2016-03-03_56d801d1a54e3.jpg", "name":"优选-亲情树进口香蕉（约8把)","spname":"约28斤/箱（约8把）","price":"118.0"}, {"img":"http://7xk7h0.com1.z0.glb.clouddn.com/2016-03-03_56d801d1a54e3.jpg", "name":"优选-亲情树进口香蕉（约8把)","spname":"约28斤/箱（约8把）","price":"118.0"},
                {"img":"http://7xk7h0.com1.z0.glb.clouddn.com/2016-03-03_56d801d1a54e3.jpg", "name":"优选-亲情树进口香蕉（约8把)","spname":"约28斤/箱（约8把）","price":"118.0"});
            $scope.$broadcast("scroll.infiniteScrollComplete");
        },100);
    }
}]);
